<template>
  <AdminLayout>
    <TabsHeader @refresh="refresh" />
    <router-view>
      <a-keep-alive v-model:clearCaches="clearCaches" v-if="show"></a-keep-alive>
    </router-view>
  </AdminLayout>
</template>

<script setup>
import AdminLayout from "../AdminLayout.vue";
import TabsHeader from './TabsHeader.vue'
import AKeepAlive from '../cache/AKeepAlive'
import { createComponents } from "../cache/components";
import { ref } from "vue";

const clearCaches = ref([])
const show = ref(false)

createComponents().then(() => {
  show.value = true
})

const refresh = (tabInfo)=>{
  clearCaches.value = [tabInfo.fullPath]
}
</script>